com.highdeal.pnr.hci
Class ChargingPlanModel

java.lang.Object
  extended by com.highdeal.pnr.hci.ChargingPlanModel
All Implemented Interfaces:
XMLMarshallable, ContextualNode

public class ChargingPlanModel
extends java.lang.Object
implements XMLMarshallable, ContextualNode

This class represents a charging plan.

Since:
Transactive 4.0

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="chargingPlan">
  <xs:complexType>
   <xs:sequence>
    <xs:element ref="usageCharge" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element ref="recurringCharge" minOccurs="0" maxOccurs="1"/>
    <xs:element ref="oneshotCharge" minOccurs="0" maxOccurs="1"/>
    <xs:element ref="defaultCharge" minOccurs="1" maxOccurs="1"/>
   </xs:sequence>
   <xs:attribute name="name" type="xs:string"/>
   <xs:attribute name="description" type="xs:string"/>
  </xs:complexType>
 </xs:element>


Constructor Summary
ChargingPlanModel()
          Creates an empty charging plan.
ChargingPlanModel(java.lang.String name, java.lang.String description)
          Creates an empty charging plan with a name and a description.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
 void addUsageCharge(UsageChargeModel usageCharge)
          Adds a usage charge and returns the old one which has the same name.
 boolean checkValidity()
          Check the validity of the charging plan.
 RatingContextDescription getContext(ContextualNode child)
          Gets the context description for the specified child; The context description contains all the context properties.
 DefaultChargeModel getDefaultCharge()
          Gets the default charge of the charging plan.
 java.lang.String getDescription()
          Gets the description of the charging plan.
 java.lang.String getName()
          Gets the name of the charging plan.
 OneShotChargeModel getOneShotCharge()
          Gets the one-shot charge.
 PricePlanModel getParent()
          Gets the price plan parent.
 RecurringChargeModel getRecurringCharge()
          Gets the recurring charge.
 UsageChargeModel getUsageCharge(java.lang.String usageChargeName)
          Returns the usage charge corresponding to the name of the usage charge.
 java.util.List<UsageChargeModel> getUsageCharges()
          Gets a list of all usage charge.
 boolean hasOnlyInternalChargingReferences()
          Checks if the charging plan has only internal charging references.
 RatingContextDescription inheritedContext()
          Gets the inherited context; The context description contains all the context properties.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, including its children.
 UsageChargeModel removeUsageCharge(int index)
          Remove the usage charge at the index.
 UsageChargeModel removeUsageCharge(java.lang.String usageChargeName)
          Remove the usage charge corresponding to the name.
 void retreiveInternalChargingReferences(java.util.List<java.lang.String> list)
          Retrieve all the internal charging references defined in the charging plan.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 void setDefaultCharge(DefaultChargeModel defaultCharge)
          Sets the default charge.
 void setDescription(java.lang.String description)
          Sets the description of the charging plan.
 void setName(java.lang.String name)
          Sets the name of the charging plan.
 void setOneShotCharge(OneShotChargeModel oneShotCharge)
          Sets the one-shot charge.
 void setParent(ContextualNode parent)
          Sets the parent node
 void setRecurringCharge(RecurringChargeModel recurringCharge)
          Sets the recurring charge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChargingPlanModel

public ChargingPlanModel()
Creates an empty charging plan.


ChargingPlanModel

public ChargingPlanModel(java.lang.String name,
                         java.lang.String description)
Creates an empty charging plan with a name and a description.

Parameters:
name - the name of the chargeable item.
description - the description given by the user.
Method Detail

getName

public java.lang.String getName()
Gets the name of the charging plan.

Returns:
the name of the charging plan.

setName

public void setName(java.lang.String name)
Sets the name of the charging plan.

Parameters:
name - the nem of the charging plan.

getDescription

public java.lang.String getDescription()
Gets the description of the charging plan.

Returns:
the description of the chargin plan.

setDescription

public void setDescription(java.lang.String description)
Sets the description of the charging plan.

Parameters:
description - the description of the charging plan.

getUsageCharge

public UsageChargeModel getUsageCharge(java.lang.String usageChargeName)
Returns the usage charge corresponding to the name of the usage charge.

Parameters:
usageChargeName - the name of the usage charge.
Returns:
the usage charge corresponding to the name of the usage charge.

addUsageCharge

public void addUsageCharge(UsageChargeModel usageCharge)
Adds a usage charge and returns the old one which has the same name.

Parameters:
usageCharge - the usage charge to add.

removeUsageCharge

public UsageChargeModel removeUsageCharge(java.lang.String usageChargeName)
Remove the usage charge corresponding to the name.

Parameters:
usageChargeName - the name of the usage charge.
Returns:
the usage charge removed and null is there isn't no usage charge corresopnding to the name.

removeUsageCharge

public UsageChargeModel removeUsageCharge(int index)
Remove the usage charge at the index.

Parameters:
index - the index of the usage charge.
Returns:
the usage charge removed and null is there isn't no usage charge at the index.

getUsageCharges

public java.util.List<UsageChargeModel> getUsageCharges()
Gets a list of all usage charge.

Returns:
the list of all usage charge.

getDefaultCharge

public DefaultChargeModel getDefaultCharge()
Gets the default charge of the charging plan.

Returns:
the default charge.
See Also:
DefaultChargeModel

setDefaultCharge

public void setDefaultCharge(DefaultChargeModel defaultCharge)
Sets the default charge.

Parameters:
defaultCharge - the default charge
See Also:
DefaultChargeModel

getRecurringCharge

public RecurringChargeModel getRecurringCharge()
Gets the recurring charge.

Returns:
the recurring charge
See Also:
RecurringChargeModel

setRecurringCharge

public void setRecurringCharge(RecurringChargeModel recurringCharge)
Sets the recurring charge.

Parameters:
recurringCharge - the recurring charge.
See Also:
RecurringChargeModel

getOneShotCharge

public OneShotChargeModel getOneShotCharge()
Gets the one-shot charge.

Returns:
the one-shot charge.
See Also:
OneShotChargeModel

setOneShotCharge

public void setOneShotCharge(OneShotChargeModel oneShotCharge)
Sets the one-shot charge.

Parameters:
oneShotCharge - the one-shot charge

retreiveInternalChargingReferences

public void retreiveInternalChargingReferences(java.util.List<java.lang.String> list)
Retrieve all the internal charging references defined in the charging plan.

Parameters:
list - the list of all the internal charging references defined in the charging plan.

hasOnlyInternalChargingReferences

public boolean hasOnlyInternalChargingReferences()
Checks if the charging plan has only internal charging references.

Returns:
true if the charging plan has only internal charging references.

checkValidity

public boolean checkValidity()
Check the validity of the charging plan. The charging plan isn't valid when:

Returns:
true when the charging plan is valid false otherwise.

getParent

public PricePlanModel getParent()
Gets the price plan parent.

Returns:
the price plan parent.

setParent

public void setParent(ContextualNode parent)
Description copied from interface: ContextualNode
Sets the parent node

Specified by:
setParent in interface ContextualNode
Parameters:
parent - The parent node

getContext

public RatingContextDescription getContext(ContextualNode child)
Description copied from interface: ContextualNode
Gets the context description for the specified child; The context description contains all the context properties.

Specified by:
getContext in interface ContextualNode
Parameters:
child - The child node
Returns:
The context description

inheritedContext

public RatingContextDescription inheritedContext()
Description copied from interface: ContextualNode
Gets the inherited context; The context description contains all the context properties.

Specified by:
inheritedContext in interface ContextualNode
Returns:
The inherited context

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the element being processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - The XML attributes of the current element

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the object, the child representing the marshallable object which must be added to the element.

Specified by:
addChild in interface XMLMarshallable
Parameters:
tagName - The name of tag for the child
child - The child to be added

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
Parameters:
cData - The character data to be added

marshal

public void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, including its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - The XML output to marshal the object into

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)